﻿using System;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using Abp.Application.Services.Dto;
using Abp.Extensions;
using LeadThing.AbpZeroTemplate.Areas;
using LeadThing.AbpZeroTemplate.EntityFramework;

namespace LeadThing.AbpZeroTemplate.Areas.EntityMapper.Areas
{

    /// <summary>
    /// 地区的数据配置文件
    /// </summary>
    public class AreaCfg : EntityTypeConfiguration<Area>
    {
        /// <summary>
        ///  构造方法[默认链接字符串< see cref = "AbpZeroTemplateDbContext" /> ]
        /// </summary>
        public AreaCfg()
        {
            ToTable("Area", AbpZeroTemplateConsts.SchemaName.Basic);

            // 行政区划代码
            Property(a => a.Code).HasMaxLength(50);
            // 城市名称
            Property(a => a.Title).HasMaxLength(100);
            // 英文首字母
            Property(a => a.FirstLetter).HasMaxLength(50);
            // X坐标
            Property(a => a.XPoint).HasMaxLength(100);
            // Y坐标
            Property(a => a.YPoint).HasMaxLength(100);
        }
    }
}